import request from '@/utils/request'

// 查询策略列表
export function policyList(query) {
  return request({
    url: '/pms/policy/list',
    method: 'get',
    params: query
  })
}

// 查询策略详细
export function getPolicy(id) {
  return request({
    url: '/pms/policy/' + id,
    method: 'get'
  })
}

// 新增策略
export function addPolicy(data) {
  return request({
    url: '/pms/policy',
    method: 'post',
    data: data
  })
}

// 修改策略
export function updatePolicy(data) {
  return request({
    url: '/pms/policy',
    method: 'put',
    data: data
  })
}

// 删除策略
export function delPolicy(id) {
  return request({
    url: '/pms/policy/' + id,
    method: 'delete'
  })
}

// 导出策略管理
export function exportPolicy(query) {
  return request({
    url: '/pms/policy/export',
    method: 'get',
    params: query
  })
}

// 查询策略状态列表
export function listState(query) {
  return request({
    url: '/pms/state/list',
    method: 'get',
    params: query
  })
}

export function getState(id) {
  return request({
    url: '/pms/state/' + id,
    method: 'get'
  })
}


// 新增状态列
export function addStateForm(data) {
  return request({
    url: '/pms/state',
    method: 'post',
    data: data
  })
}

// 修改状态列
export function updateState(data) {
  return request({
    url: '/pms/state',
    method: 'put',
    data: data
  })
}

// 删除状态列
export function delState(Id) {
  return request({
    url: '/pms/state/' + Id,
    method: 'delete'
  })
}
